//
//  TestViewController.m
//  YSSmartHome
//
//  Created by yanghao on 2016/10/20.
//  Copyright © 2016年 yahaong. All rights reserved.
//

#import "TestViewController.h"
#import "YSUDPSocket.h"
#import <sys/sysctl.h>
#import <Bugly/Bugly.h>
#import <string>
#import "ZTLCCameraUtil.h"
#import "openApiService.h"
#import "LCOpenSDK_Api.h"
#import "RestApiService.h"
#import "WaveView.h"
#import "AirAttributedView.h"
#import "AirContentScrollView.h"
#import "GatewayPermitView.h"
using namespace std;
@interface TestViewController ()
<
UIScrollViewDelegate
>
@property (nullable, nonatomic, strong) AirContentScrollView* mScrollView;

@property (nullable, nonatomic, strong) GatewayPermitView* permitView ;
@property(nonatomic, strong)YSUDPSocket *udpSocket;
@end

@implementation TestViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
//    self.view.backgroundColor =  RGBColor(0, 111, 195);
//    self.navigationItem.title = @"空气检测器";
//    self.automaticallyAdjustsScrollViewInsets = NO;
//    self.edgesForExtendedLayout = UIRectEdgeNone;
//    [self.view addSubview:self.mScrollView];
//    [self.mScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.edges.equalTo(self.view);
//    }];
    self.view.backgroundColor = kBgColor;
    GatewayPermitView* permitView = [GatewayPermitView gatewayPermitView];
    [self.view addSubview:permitView];
    [permitView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view);
//        make.height.equalTo(195);
    }];
    self.permitView = permitView;
//    permitView.frame = CGRectMake(10, 200, 270, 159);
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    self.permitView.titleLable.text = @"objc[6331]: Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/";
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)testSignalException {
    NSLog(@"test signal exception");
    NSString * null = nil;
    NSLog(@"print the nil string %s", [null UTF8String]);
    NSLog(@"print the nil string to c string: %s", std::string([null UTF8String]).c_str());
}
- (void)testNSException {
    NSLog(@"it will throw an NSException ");
    NSArray * array = @[];
    NSLog(@"the element is %@", array[1]);
}

#pragma mark - private method
- (void)initUDPSocket
{
    self.udpSocket = [[YSUDPSocket alloc]init];
    [self.udpSocket setupUDPSocketBindingPort:0x3838];
}

- (AirContentScrollView *)mScrollView
{
    if (!_mScrollView) {
        _mScrollView = [[AirContentScrollView alloc]init];
        _mScrollView.showsVerticalScrollIndicator = NO;
        _mScrollView.showsHorizontalScrollIndicator = NO;
//        _mScrollView.delegate = self;
        
    }
    return _mScrollView;

}
@end
